import Home from '../components/home/Home.vue'
import Search from '../components/home/Search.vue'
import Pay from '../components/home/Pay.vue'
import Test from '../components/home/test.vue'
import CommodityDetails from '../components/home/CommodityDetails.vue'
import MyOrder from '../components/home/myorder.vue'
import MyAttention from '../components/home/myattention.vue'
import MyFootprint from '../components/home/myfootprint.vue'
import Payment from '../components/home/Payment.vue'
import Shoppingcart from '../components/home/Shoppingcart.vue'
// 登录、注册路由
import Login from '../components/home/Login'
import Register from '../components/home/Register'
import Admin from '../components/admin/Admin'
import Users from '../views/admin/users'
import WebsiteInfo from '../views/admin/WebsiteInfo'
import RotationChart from '../views/admin/RotationChart'
import Commodity from '../views/admin/commodity'
import QRcode from '../views/admin/QRcode'
import RecordInfo from '../views/admin/RecordInfo'
import Welcome from '../views/admin/Welcome'
import Order from '../views/admin/order'
import Classification from '../views/admin/classification'
import Information from '../components/home/Information'

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: {
      hidden: true
    },
    component: Home
  },
  {
    path: '/Login',
    name: 'Home',
    meta: {
      hidden: true
    },
    component: Login
  },
  {
    path: '/Register',
    name: 'Home',
    meta: {
      hidden: true
    },
    component: Register
  },
  {
    path: '/admin',
    name: 'Admin',
    meta: {
      hidden: true
    },
    component: Admin
  },
  {
    path: '/search',
    meta: {
      hidden: true
    },
    component: Search
  },
  {
    path: '/pay',
    meta: {
      hidden: true
    },
    component: Pay
  },
  {
    path: '/CommodityDetails',
    name: '商品详情页',
    meta: {
      hidden: true
    },
    component: CommodityDetails
  },
  {
    path: '/MyOrder',
    name: '我的订单',
    meta: {
      hidden: true
    },
    component: MyOrder
  },
  {
    path: '/MyAttention',
    name: '我的关注',
    meta: {
      hidden: true
    },
    component: MyAttention
  },
  {
    path: '/myfootprint',
    name: '我的足迹',
    meta: {
      hidden: true
    },
    component: MyFootprint
  },
  {
    path: '/Information',
    name: '我的足迹',
    meta: {
      hidden: true
    },
    component: Information
  },
  {
    path: '/Payment',
    name: '支付方式',
    meta: {
      hidden: true
    },
    component: Payment
  },
  {
    path: '/Shoppingcart',
    name: '购物车',
    meta: {
      hidden: true
    },
    component: Shoppingcart
  },
  {
    path: '/test',
    meta: {
      hidden: true
    },
    component: Test
  },
  {
    path: '/admin',
    component: Admin,
    meta: {
      title: '管理员首页',
      icon: 'el-icon-coin',
      hidden: true
    },
    children: [
      {
          path: 'asd',
          meta: {
              title: '首页',
              icon: 'el-icon-s-home',
          },
          component: Welcome
      },
      {
        path: 'users',
        meta: {
          title: '用户管理',
          icon: 'el-icon-s-custom'
        },
        component: Users
      },
      {
        path: 'website_info',
        meta: {
          title: '网站信息管理',
          icon: 'el-icon-s-platform'
        },
        component: WebsiteInfo
      },
      {
        path: 'rotation_chart',
        meta: {
          title: '轮播模块管理',
          icon: 'el-icon-film'
        },
        component: RotationChart
      },
      {
        path: 'article',
        meta: {
          title: '商品管理',
          icon: 'el-icon-s-goods'
        },
        component: Commodity
      },
      {
        path: 'QR_code',
        meta: {
          title: '二维码管理',
          icon: 'el-icon-s-grid'
        },
        component: QRcode
      },
      {
        path: 'record_info',
        meta: {
          title: '供货商管理',
          icon: 'el-icon-edit-outline'
        },
        component: RecordInfo
      },
      {
        path: 'order',
        meta: {
          title: '订单管理',
          icon: 'el-icon-s-claim'
        },
        component: Order
      },
      {
        path: 'classification',
        meta: {
          title: '分类管理',
          icon: 'el-icon-s-order'
        },
        component: Classification
      }
    ]
  },
  {
    path: '/login',
    meta: {
      title: '登录',
      icon: 'el-icon-edit-outline',
      hidden: true
    },
    component: Login,
  },
  {
    path: '/register',

    meta: {
      title: '注册',
      icon: 'el-icon-edit-outline',
      hidden: true
    },
    component: Register,
  }
]


export default routes